<template>
	<view class="warp">
		<u-toast ref="uToast"></u-toast>
		<setmeal-card :setmealList="setmealList"></setmeal-card>
		<!-- <u-button type="primary" text="确定" @click="getSetmeal"></u-button> -->
	</view>
</template>

<script>
import setmealCard from "../setmealCard/setmealCard.vue"
	export default {
		components:{setmealCard},
		data() {
			return {
				setmealList:[]
			}
		},
		methods: {
			getSetmeal(){
				uni.request({
					url:'http:127.0.0.1:84/setmeal/getAllSetmeal.do',
					header: {
						'content-type': 'application/json'
					},
					method:"GET",
					success:res=>{
						console.log(res.data)
						if(res.data.flag){
							this.setmealList = res.data.data
						}else{
							this.$refs.uToast.show({
								type:'error',
								message:res.data.message,
							})
						}
						
					}
				})
				// console.log(111)
			}
		},
		onLoad() {
			uni.request({
				url:'/api/setmeal/getAllSetmeal.do',
				header: {
					'content-type': 'application/json'
				},
				method:"GET",
				success:res=>{
					// console.log(res.data)
					if(res.data.flag){
						this.setmealList = res.data.data
					}else{
						this.$refs.uToast.show({
							type:'error',
							message:res.data.message,
						})
					}
					
				}
			})
			// console.log(111)
		}
	}
</script>

<style scoped>
	.warp{
		padding: 30rpx;
	}
</style>
